﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Web.Core;
using Web.Core.Objects;
using System.Globalization;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //this.content5.LoadControl(
        if (Session["Language"] == null)
        {
            Session["Language"] = GlobalStorage.Language.Vietnamese;
            Resources.Lang.Culture = new CultureInfo("vi");
        }
        if (Session["Currency"] == null)
            Session["Currency"] = Currencies.GetCurrenciesByName("US Dollar");
        getPage(Request.Params["act"]);
    }

    private void getPage(string act)
    {
        if (act != null)
        {
            switch (act.ToLower())
            {
                case "category":
                    this.content_main.Controls.Clear();
                    Control toAdd = LoadControl("~/include/categorys.ascx");
                    this.content_main.Controls.Add(toAdd);
                    break;
                case "product":
                    this.content_main.Controls.Clear();
                    Control pro = LoadControl("~/include/product.ascx");
                    this.content_main.Controls.Add(pro);
                    break;
                case "contact":
                    this.content_main.Controls.Clear();
                    Control con = LoadControl("~/include/contact.ascx");
                    this.content_main.Controls.Add(con);
                    break;
                case "about":
                    this.content_main.Controls.Clear();
                    Control about = LoadControl("~/include/about.ascx");
                    this.content_main.Controls.Add(about);
                    break;
                default:
                    this.content_main.Controls.Clear();
                    Control notfound = LoadControl("~/include/notfound.ascx");
                    this.content_main.Controls.Add(notfound);
                    break;
            }
        }
    }
}
